//
// Created by Administrator on 2021/9/29.
//
#include "FileUtil.h"

/**
 * 从文件中字符串
 * @param filePath 文件路径
 * @return c字符串
 */
std::string FileUtil::readStrFromFile(const char *filePath) {
    //读取文件
    std::fstream ffstream;
    std::stringstream  fStringSteam;

    ffstream.exceptions(std::ifstream::failbit | std::ifstream::badbit);
    ffstream.open(filePath);
    fStringSteam << ffstream.rdbuf();

    ffstream.close();

    return fStringSteam.str();
}
